//
//  WalletCell.m
//  LuxuryGoods
//
//  Created by DCQ on 2018/5/24.
//  Copyright © 2018年 Future. All rights reserved.
//

#import "WalletIncomeCell.h"
#import "WalletListModel.h"
@interface WalletIncomeCell()
@property (weak, nonatomic) IBOutlet UILabel *titleLabel;
@property (weak, nonatomic) IBOutlet UILabel *dateLabel;
@property (weak, nonatomic) IBOutlet UILabel *moneyLabel;

@end
@implementation WalletIncomeCell

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}
- (void)setupWalletModel:(WalletInfoModel *)model{
   
    self.titleLabel.text =   model.name;
    
    self.dateLabel.text = model.createtime;
    // 0-收入 1-支出
    NSString * symbolStr = @"";
    UIColor * moneyColor;
    if ([model.type integerValue] == 0) {
        symbolStr = @"+";
        moneyColor = UIColorFromRGB(0x26AA51);
    }else if ([model.type integerValue] == 1) {
        symbolStr = @"-";
        moneyColor = UIColorFromRGB(0xFF8D6C);
    }
    self.moneyLabel.text = [NSString stringWithFormat:@"%@￥%@",symbolStr,model.price];
    self.moneyLabel.textColor = moneyColor;
}

- (NSString *)getTitleStr:(NSNumber *)type{
    NSString * titelStr = @"";
    //变动类型 1-充值 2-充值赠送 3-佣金收入 4-平台调整 10-购物 11-养护 12-购物 20-提现
    switch ([type integerValue]) {
        case 1:
            titelStr = @"充值";
            break;
        case 2:
            titelStr = @"充值赠送";
            break;
        case 3:
            titelStr = @"佣金收入";
            break;
        case 4:
            titelStr = @"平台调整";
            break;
        case 10:
            titelStr = @"购物";
            break;
        case 11:
            titelStr = @"养护";
            break;
        case 12:
            titelStr = @"购物";
            break;
        case 20:
            titelStr = @"提现";
            break;
        default:
            break;
    }
    return titelStr;
}
@end
